/**
 * 
 */
package hihocoder;

import java.util.Scanner;

/**
 * 给出n,k。求bad指数为k的长度为2n的不一定合法括号序列的个数。 思路：有k个有括号在前面找不到匹配
 * 
 * @author zhongfang
 *
 */
public class 不一定合法括号序列 {
	static int mod = 1000000007;

	static long res = 0;

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int kk = scanner.nextInt();
		k = kk;
		getRes(0, n, 0, 0, 0, 0);
		System.out.println(res);
	}

	static int k = 0;

	private static void getRes(int index, int n, int countL, int countR, int bad, int unMatchedLeft) {
		if (index == n) {
			res++;
			if (res == mod) {
				res = 0;
			}
		}
		if (countL < n) {// 放左
			getRes(index + 1, n, countL + 1, countR, bad, unMatchedLeft + 1);
		}
		// 放右
		if (countR < n) {
			if (unMatchedLeft == 0) {// 没有待匹配的左括号，放了之后会bad
				if (bad == k) {					// 不能放
				} else {//能够放，使bad+1——未匹配right
					getRes(index + 1, n, countL, countR + 1, bad + 1, unMatchedLeft);
				}
			} else { // 抵消左的个数
				getRes(index + 1, n, countL, countR + 1, bad, unMatchedLeft - 1);
			}
		}
	}
}
